From 354eab70daa8cce776b21623a6ee676e687e50b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Mon, 26 Feb 2018 12:29:11 +0100 Subject: [PATCH] entry: Allocate icons at full height Makes for a larger hit area for pointing devices. If vertical centering is still desired, GtkWidget:halign can be set on the icon widgets. --- gtk/gtkentry.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index f943193761..a032b9db87 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -3182,7 +3182,7 @@ gtk_entry_size_allocate (GtkWidget *widget, { EntryIconInfo *icon_info = priv->icons[i]; GtkAllocation icon_alloc; - gint width, height; + int width; if (!icon_info) continue; @@ -3192,11 +3192,6 @@ gtk_entry_size_allocate (GtkWidget *widget, -1, NULL, &width, NULL, NULL); - gtk_widget_measure (icon_info->widget, - GTK_ORIENTATION_VERTICAL, - -1, - NULL, &height, - NULL, NULL); if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL && i == GTK_ENTRY_ICON_PRIMARY) || (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR && i == GTK_ENTRY_ICON_SECONDARY)) @@ -3208,9 +3203,9 @@ gtk_entry_size_allocate (GtkWidget *widget, icon_alloc.x = allocation->x + priv->text_x; priv->text_x += width; } - icon_alloc.y = allocation->y + (allocation->height - height) / 2; + icon_alloc.y = 0; icon_alloc.width = width; - icon_alloc.height = height; + icon_alloc.height = allocation->height; priv->text_width -= width; gtk_widget_size_allocate (icon_info->widget, &icon_alloc, baseline, &child_clip); -- 2.30.2